package org.phalanx.server.ServerCache;

import java.util.Iterator;

public class RemoteCacheManager implements CacheListener {
	CacheManager cacheMgr;
	
	public RemoteCacheManager(CacheManager cacheMgr){
		this.cacheMgr = cacheMgr; 
	}
	
	public void initializeRemoteCacheSyncing(){
		// Takes all the caches and adds this class as the internal listener
		
		Iterator<Cache> i = cacheMgr.getAllCaches().iterator();
		
		while(i.hasNext()){
			String cacheName = i.next().getCacheName();
			
			cacheMgr.addCacheListener(cacheName, this);
		}
	}
	
	@Override
	public void onCacheAdded(Cacheable c, String cacheName, boolean dbUpdated) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onCacheDeleted(Cacheable c, String cacheName, boolean dbUpdated) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onCacheModified(Cacheable c, String cacheName, boolean dbUpdated) {
		// TODO Auto-generated method stub

	}

}
